package com.zeratul.common.pool.decorator;

import org.springframework.core.task.VirtualThreadTaskExecutor;

/**
 * 自定义虚拟线程池 - 拓展支持上下文数据继承
 */
public class ZtVirtualThreadTaskExecutor extends VirtualThreadTaskExecutor {

    public ZtVirtualThreadTaskExecutor(String prefix) {
        super(prefix);
    }

    @Override
    public void execute(Runnable runnable) {
        //创建包装后的任务
        super.execute(new ZtTaskDecorator().decorate(runnable));
    }
}
